let usernameModel = require('../models/userModel');

module.exports={
    async getUserByusernameAndpwd(username,pwd){
     let result= await usernameModel.findOne({username,pwd}).exec();
        return result;
    },
    //根据用户名和查询用户
    async getusername(username){
        let result = await usernameModel.findOne({username}).exec();
        return result;
    },
    //添加新用户
    async addUser(username,pwd){
        let result = await usernameModel.create({username,pwd})
        return result;
    }

}